<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserPushMsgTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_push_msg', function (Blueprint $table) {
            $table->id();
            $table->string('send_id')->nullable(true)->comment('推送id');
            $table->tinyInteger('type')->nullable(true)->default(2)->comment('发送类型：1-全体；2-单用户');
            $table->unsignedInteger('user_id')->comment('用户id');
            $table->string('title')->nullable(false)->comment('信息内容');
            $table->text('msg')->comment('信息内容');
            $table->tinyInteger('is_read')->default(0)->comment('是否阅读：0-未读；1-已读；');
            $table->timestamp('read_time')->nullable(true)->comment('阅读时间');
            $table->softDeletes();
            $table->timestamps();

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_push_msg');
    }
}
